TST: solid_motor.py testing refactors#494
Merged
MateusStano merged 2 commits intodevelopfrom Dec 2, 2023
Merged
Conversation
While studying some of the tests that were written, I made some simple changes to conftest.py, test_function.py and test_solidmotor.py.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #494 +/- ##
=======================================
Coverage 70.91% 70.91%
=======================================
Files 55 55
Lines 9261 9261
=======================================
Hits 6567 6567
Misses 2694 2694
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
MateusStano
approved these changes
Dec 2, 2023
Member
Gui-FernandesBR
left a comment
There was a problem hiding this comment.
Sorry for the incovinience but I'd like to say that, actually, I didn't review this one. I was trying to approve other PR but got confused.
@MateusStano I'm trusting your review now.
MateusStano
added a commit
that referenced
this pull request
Dec 2, 2023
commit 7722736 Merge: feb3299 62c8bb6 Author: MateusStano <69485049+MateusStano@users.noreply.github.com> Date: Sat Dec 2 11:54:10 2023 -0300 Merge pull request #494 from RocketPy-Team/tst/testing-refactor TST: solid_motor.py testing refactors commit feb3299 Merge: a9ac31c b27edc3 Author: MateusStano <69485049+MateusStano@users.noreply.github.com> Date: Sat Dec 2 11:46:54 2023 -0300 Merge pull request #477 from RocketPy-Team/enh/get-attributes ENH: Get Instance Attributes commit b27edc3 Author: MateusStano <mateusstano@usp.br> Date: Wed Nov 29 19:01:32 2023 +0100 TST: add test commit dcdd6bd Merge: 438f4c0 191ab9f Author: MateusStano <mateusstano@usp.br> Date: Wed Nov 29 18:04:31 2023 +0100 Merge remote-tracking branch 'origin/develop' into enh/get-attributes commit 438f4c0 Author: MateusStano <mateusstano@usp.br> Date: Wed Nov 29 17:44:19 2023 +0100 MNT: improve warnings commit 62c8bb6 Author: Lint Action <lint-action@samuelmeuli.com> Date: Wed Nov 29 03:39:29 2023 +0000 Fix code style issues with Black commit 0180755 Author: Lucas <69172945+lucasfourier@users.noreply.github.com> Date: Wed Nov 29 00:16:45 2023 -0300 TST: Simple refactoring While studying some of the tests that were written, I made some simple changes to conftest.py, test_function.py and test_solidmotor.py. commit 04b751d Author: MateusStano <mateusstano@usp.br> Date: Fri Nov 17 19:08:21 2023 +0100 BUG: fix time_array assignment in Environment class commit 1dd5e1e Author: MateusStano <mateusstano@usp.br> Date: Fri Nov 17 19:08:09 2023 +0100 ENH refactor get_instance_attributes function to filter out methods and protected attributes commit 931f330 Author: MateusStano <mateusstano@usp.br> Date: Fri Nov 17 16:16:09 2023 +0100 MNT: add deprecation warnings commit 2368cab Author: MateusStano <mateusstano@usp.br> Date: Fri Nov 17 16:15:56 2023 +0100 ENH: add get attributes function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request type
Checklist
black rocketpy/ tests/) has passed locallypytest --runslow) have passed locallyCHANGELOG.mdhas been updated (if relevant)Current behavior
Currently, test_solidmotor.py creates a motor inside the testing module called 'test_reshape_thrust_curve_asserts_resultant_thrust_curve_correct', which is not adequate. This method also does not contains comments.
Inside the test_function.py testing module the 'test_differentiate' method relies on manually passing the inputs.
New behavior
The solution employed was to create a motor in conftest.py, which was called 'cesaroni_m1670_shifted', and which was used in the test method called 'test_reshape_thrust_curve_asserts_resultant_thrust_curve_correct'. Comments were also made.
It was properly refactored and new comments were made. Also, @pytest.mark.parametrize was introduced to make the test method ready to handle more test cases. This test was introduced in TST: new set of tests #467.
Breaking change
Additional information
This PR is part of the effort of reorganizing the test suite. It does so by making sure that the tests which could certainly be classified as unit tests are properly refactored and implemented before the test suite is reorganized. For more info, check #480.